<%@ include file="/include.jsp" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
  <link rel="stylesheet" type="text/css" href="styles/default.css" >
  <script type="text/javascript" src="scripts/common.js"></script>
  <script type="text/javascript" src="scripts/date.js"></script>
  <script type="text/javascript" src="scripts/check.js"></script>
</head>

<body>
<form name="StatDecls" action="StatDecls.do" method="post">
<div class="main" style="width:100%;">
	<table border="0" cellspacing="0" cellpadding="0" width="100%" align="center">
		<caption>
		 报检单综合统计查询
		</caption>
		<tr>
		  <td>
		     <table border="0" width="70%">
		       <tr>
		         <td width="20%"></td>
		         <td width="28%"></td>
		         <td width="15%"></td>
		         <td ></td>
		       </tr>
		       <tr >
		         <td align="right">报检号</td>
		         <td><input type="text" name="declNo" value="${map.cdecl.declNo}"></td>
		      	 <td align="right">备案号</td>
		      	 <td>
		      		<mytag:comSearch code="${map.cdecl.backupCode}" name="backupCode" type="backupCode"/>
		      	</td>
		    	</tr>
		    	<tr >
			      	 <td align="right">报检类型</td>
			      	 <td>
			      	   <mytag:select type="type" name="type" selectedCode="${map.cdecl.type}"/>
			         </td>
			         <td align="right">报检单位</td>
			         <td>
			      	   <input type="text" name="entName"  value="${map.cdecl.entName}">
			         </td>
		    	</tr>
		    	<tr >
			         <td align="right">发货人</td>
			         <td>
			      	   <input type="text" name="consignorCname"  value="${map.cdecl.consignorCname}">
			         </td>
			      	 <td align="right">收货人</td>
			      	 <td>
			      	   <input type="text" name="consigneeCname"  value="${map.cdecl.consigneeCname}">
			         </td>
		    	</tr>
		    	<tr >
			         <td align="right">贸易方式</td>
			         <td>
				 		<mytag:comSearch code="${map.cdecl.tradeModeCode}" name="tradeModeCode" type="trade"/>
				 	</td>
			      	 <td align="right">贸易国/地区</td>
			      	 <td>
				      	 <mytag:comSearch code="${map.cdecl.tradeCountryCode}" name="tradeCountryCode" type="country"/>
			         </td>
		    	</tr>
		    	<tr>
		    		<td align="right">施检机构</td>
			      	<td>
						<mytag:comSearch code="${map.cdecl.inspOrgCode}" name="inspOrgCode" type="org"/>
				 	</td>
			    	<td align="right">施检部门</td>
			      	<td>
						<mytag:comSearch code="${map.cdecl.inspDept1}" name="inspDept1" type="dept"/>
				 	</td>
		    	</tr>
		    	<tr>
			    	<td align="right">运输方式</td>
			    	<td>
						<mytag:select type="tran" name="transTypeCode" selectedCode="${map.cdecl.transTypeCode}"/>
			         </td>
				 	<td align="right">报检日期范围</td>
				 	<td>
				 		<input type="text" class="readonly" name="inspDept4" value="${map.cdecl.inspDept4}" readonly="readonly" style="width:70px;" onclick="setday(this)">
				 		～
				 		<input type="text" class="readonly" name="inspDept5" value="${map.cdecl.inspDept5}" readonly="readonly" style="width:70px;" onclick="setday(this)">
				 	</td>
		   	 	</tr>
		    	<tr>
		    		<td align="right">CIQ综合评定</td>
			      	<td>
						<mytag:select type="testResult" name="colligateResult" selectedCode="${map.cdecl.colligateResult}"/>
				 	</td>
			    	<td align="right">监管</td>
			      	<td>
						<mytag:select type="Check_result" name="markNo" selectedCode="${map.cdecl.markNo}"/>
				 	</td>
		    	</tr>
		        <tr class="button">
		         <td colspan="4">
		         	<input type="submit" value=" 查询 " />&nbsp;
		         	<c:if test="${map.cdecl.feeStatus==null}" ><input type="button" value=" 导出 " onclick="return exportDecls();" />&nbsp;</c:if>
		           	<input type="button" value=" 清空 " onclick="clearInput();" />
		         </td>
		        </tr>
		        
		        <tr class="button">
		        	<td colspan="4">
				        <div style="font-weight:600;font-size:13px;">
				         	<span><input type="checkbox" class="noborder" name="feeStatus" value="on" <c:if test="${map.cdecl.feeStatus!=null}" >checked</c:if> >统计栏</span>
						</div>
						<c:if test="${map.cdecl.feeStatus!=null}" >
							<table class="list" style="background-color:#C4FFF5;width:65%;">
								<tr>
									<td rowspan="2" scope="col">报检批数</td>
									<td rowspan="2" scope="col">货物批数</td>
									<td rowspan="2" scope="col">货物总值(美元)</td>
									<td rowspan="2" scope="col">集装箱数</td>
									<td colspan="3" scope="col">报检单检验检疫</td>
									<td colspan="3" scope="col">集装箱检验检疫</td>
								</tr>
								<tr style="background-color:#C4FFF5;" >
									<td>合&nbsp;&nbsp;格</td>
									<td>处理合格</td>
									<td>不合格</td>
									<td>合&nbsp;&nbsp;格</td>
									<td>处理合格</td>
									<td>不合格</td>
								</tr>
								<tr style="background-color:#FFF;">
									<c:forEach var="count" items="${map.statCounts}">
										<td><fmt:formatNumber value="${count}" /> </td>
									</c:forEach>
								</tr>
							</table>
							<br>
							<table class="list" style="background-color:#C4FFF5;width:65%;">
								<tr>
									<td rowspan="2" scope="col" width="5%">序号</td>
									<td rowspan="2" scope="col">集装箱规格</td>
									<td rowspan="2" scope="col">数量</td>
									<td colspan="3" scope="col">集装箱检验检疫</td>
								</tr>
								<tr style="background-color:#C4FFF5;" >
									<td>合&nbsp;&nbsp;格</td>
									<td>处理合格</td>
									<td>不合格</td>
								</tr>
								<c:forEach var="container" varStatus="stat"  items="${map.statContainer}">
									<tr>
										<td>${stat.count}</td>
										<td><mytag:c2s key="${container.containerModelCode}" type="container"/></td>
										<td>${container.map["all"]}</td>
										<td>${container.map["good"]}</td>
										<td>${container.map["beGood"]}</td>
										<td>${container.map["bad"]}</td>
									</tr>
								</c:forEach>
							</table>
							<br>
							<table class="list" style="background-color:#C4FFF5;width:65%;">
								<tr>
									<td rowspan="2" scope="col" width="5%">序号</td>
									<td rowspan="2" scope="col">集装箱规格</td>
									<td colspan="2" scope="col">来自疫区</td>
									<td colspan="2" scope="col">动物疫区</td>
									<td colspan="2" scope="col">植物疫区</td>
									<td colspan="2" scope="col">卫生疫区</td>
								</tr>
								<tr style="background-color:#C4FFF5;" >
									<td>批数</td>
									<td>集装箱数</td>
									<td>批数</td>
									<td>集装箱数</td>
									<td>批数</td>
									<td>集装箱数</td>
									<td>批数</td>
									<td>集装箱数</td>
								</tr>
								<c:forEach var="container" varStatus="stat"  items="${map.statEpidemicContainer}">
									<tr>
										<td>${stat.count}</td>
										<td><mytag:c2s key="${container.containerModelCode}" type="container"/></td>
										<td>${container.map["sumDecl"]}</td>
										<td>${container.map["sumCon"]}</td>
										<td>${container.map["animalDecl"]}</td>
										<td>${container.map["animalCon"]}</td>
										<td>${container.map["plantDecl"]}</td>
										<td>${container.map["plantCon"]}</td>
										<td>${container.map["healthDecl"]}</td>
										<td>${container.map["healthCon"]}</td>
									</tr>
								</c:forEach>
							</table>
						</c:if>
		        	</td>
		        </tr>
	     </table>
	  </td>
	</tr>
	 
<c:if test="${map.cdecl.feeStatus==null}" >
	
	<tr height="30">
	    <td align="center">
	    	<mytag:pagination pager="${map.page}" pageSize="10"  suppressHidden="true"/>
	    </td>
	</tr>
		<tbody>
		  <tr>
		    <td align="center">
		      <table class="list">
		        <tr class="title">
		          <td width="4%">序号</td>
		          <td>报检号</td>
		          <td>备案号</td>
		          <td>报检类型</td>
		          <td>贸易方式</td>
		          <td>报检单位</td>
		          <td>报检日期</td>
		          <td>CIQ综合评定</td>
		          <td>监管</td>
		          <td width="5%">操作</td>
		        </tr>
				<c:forEach items="${map.page.items}" varStatus="stat" var="decl">
			        <tr>
			          <td>${stat.count+map.page.seq}</td>
			          <td>${decl.declNo}</td>
			          <td><mytag:c2s key="${decl.backupCode}" type="backupCode"/></td>
			          <td><mytag:c2s key="${decl.type}" type="type"/></td>
			          <td><mytag:c2s key="${decl.tradeModeCode}" type="trade"/></td>
			          <td>${decl.entName}</td>
			          <td><fmt:formatDate value="${decl.declDate}" pattern="yyyy-MM-dd"/> </td>
			          <td><mytag:c2s type="testResult" key="${decl.colligateResult}"/></td>
			          <td>
			          	<c:if test="${decl.supervisePlan!=null}">
				          	<mytag:c2s type="Check_result" key="${decl.supervisePlan.result}"/>
			          	</c:if>
			          </td>
			          <td>
			          <c:if test="${decl.type=='A'}">
			           <a class="deco" href="NormalDeclView.html?id=${decl.id}">查看</a>
			          </c:if>
			          <c:if test="${decl.type=='B'}">
			           <a class="deco" href="MainDeclView.html?id=${decl.id}">查看</a>
			          </c:if>
			          </td>         
			        </tr>
				</c:forEach>
		      </table>
		    </td>
		  </tr>
		</tbody>
		<tr height="30">
		  <td align="center">
		  	<mytag:pagination pager="${map.page}" pageSize="10"  suppressHidden="false"/>
		  </td>
		</tr>
	</table>
	
</c:if>
	
</div>
</form>
</body>
</html>
